package com.wengluobiancheng.demo01;

import java.io.IOException;
import java.net.*;

public class Demo02 {
    public static void main(String[] args) throws IOException {
        DatagramSocket dts = new DatagramSocket();
        String s = "送给汪纪坤的学习资料";
        byte[] bytes = s.getBytes();
        InetAddress ia = InetAddress.getByName("10.254.3.162");
        int port = 10000;
        DatagramPacket dp = new DatagramPacket(bytes, bytes.length, ia, port);
        dts.send(dp);
        dts.close();
    }
}
